package org.wlc.demov4;

public class Factory{

        public  Fruit getInstance(String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException {

            Fruit fruit = (Fruit) Class.forName(className).newInstance();
            return fruit;
        }
    }
